Flash Article

Integrating Video into Macromedia Flash


Table of Contents

  1. Introduction
  2. Embedding Video Directly in a Flash Document
  3. Importing Video into a Flash document
  4. Using Flash Media Components
  5. Adding Streaming Media to a Media Component
  6. Using the Component Inspector
  7. Streaming Media File Formats
  8. Streaming Video

Streaming Video

During this walkthrough, you will export video to create a FLV file, add a Media Playback component instance to a document, and select the FLV file to stream in the instance.

  1. Create a new Flash document.
  2. Export video:

    1. Import cyclers.mov from the directory where you unzipped the files to the library.
    2. Double-click cyclers.mov in the library to view its Embedded Video Properties. Ensure that you click the movie icon and not the text, otherwise, you will rename the text.
    3. Select Export.
    4. Use the Export FLV dialog box to save the exported file as cyclers.flv in the {webroot}.

      Note: If you are using Microsoft Internet Information Server (IIS), the web root is typically, c:\inetpub\wwwroot.

    5. Click Save and OK.
    6. Delete cyclers.mov in the library to maintain minimum document size.

  3. Add a Video Playback component:

    1. Drag an instance of the MediaPlayback component from the Components panel to the Stage.
    2. Use the Property inspector to define the component’s properties:

      • Width: 190
      • Height:130
      • X: 139
      • Y: 132

  4. Add video to the Video Playback component:

    1. Select the component instance on the Stage and click Launch Component Inspector on the Parameters tab of the Property inspector.

      Note: This automatically opens the Component Inspector panel in the docked panels.

    2. On the Component Inspector panel, select the FLV file type for the streaming media.
    3. Enter http://localhost/cyclers.flv in the URL field to stream the cyclers.flv file from that location.

  5. Save and test the application:

    1. Save and test the application.
    2. View the streaming video.
    3. Choose View > Bandwidth profiler and note how much smaller the video file is.

  6. Close the SWF and FLA

Summary

This article focuses on two ways of importing video into Flash:

  • Embedding the video directly into a Flash document
  • Using the media components.

The media components result in much smaller file sizes because the video is steamed down from a server; in addition they provide convenient user controls. To stream from a server, you must export the video as an FLV file from the Flash environment.

Embedding video into a Flash document is inherently more flexible because you can easily sync the video to animations or actions occurring on a Flash timeline. If you do embed video, it is a best practice to store the video in a separate MovieClip timeline because it allows you to more easily manipulate the video.